﻿@using UCosmic.Www.Mvc.Areas.Identity.Models.Self
@model PersonForm.AffiliationInfo
<div class="affiliation">
    <div>
        <span class="affiliation-name">@Model.Establishment.OfficialName</span>
        @if (!Model.IsAcknowledged)
        {
            <span class="affiliation-unacknowledged">You have not yet set up this affiliation.</span>
            <span class="affiliation-actions">
                @Html.ActionLink("Set up affiliation", MVC.Identity.Self.ActionNames.EditAffiliation,
                    new { entityId = Model.EntityId }, new { @class = "affiliation-edit" })</span>
        }
        else
        {
            <span class="affiliation-actions">
                @Html.ActionLink("Edit affiliation info", MVC.Identity.Self.ActionNames.EditAffiliation,
                    new { entityId = Model.EntityId }, new { @class = "affiliation-edit" })</span>
        }
    </div>
    @if (Model.IsAcknowledged)
    {
        <div class="affiliation-type-info">
            @if (Model.IsClaimingEmployee || !Model.Establishment.IsInstitution)
            {
                <div class="@Html.NullDisplayCssClassFor(m => Model.JobTitles) is-employee">
                    @Html.DisplayFor(m => Model.JobTitles).LineBreaksToHtml()
                </div>
            }
            else if (Model.IsClaimingStudent && Model.Establishment.IsInstitution)
            {
                <div class="is-student">
                    Student
                </div>
            }
            else if (Model.Establishment.IsInstitution)
            {
                <div class="is-neither">
                    Neither student nor employee
                </div>
            }
        </div>
    }
</div>
